﻿<Window x:Class="AzureDriverExplorer_Client.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Azure Drive Explorer" Height="769" Width="1140" 
xmlns:my="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon" WindowStartupLocation="CenterScreen" WindowState="Maximized" Window.Background="Transparent"  Loaded="Window_Loaded" Closing="Window_Closing"
         
        >
    <Window.Resources>
        <!--Menu-->


        <!-- This style is used for buttons, to remove the WPF default 'animated' mouse over effect -->
        <Style x:Key="StyleCancelBotton" TargetType="Button">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Margin" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Name="border" 
                            BorderThickness="1"                             
                            BorderBrush="Red" 
                            CornerRadius="3"
                           Background="#32E1DFCD">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="border" Property="BorderBrush" Value="Black" />
                                <Setter TargetName="border" Property="Background" Value="#4BEA0000" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <Grid >
        <Grid Height="auto" Width="auto" >
            <Grid.RowDefinitions>
                <RowDefinition Height="115" />
                <RowDefinition Height="*" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="28" />

            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>

                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>

            <!--*********** RIBBON ****************-->
            <my:Ribbon x:Name="Ri_Menu"  Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="7" Background="#D3A7D3F5" Loaded="Ri_Menu_Loaded">
                <my:Ribbon.QuickAccessToolBar>
                    <my:RibbonQuickAccessToolBar >
                        <my:RibbonButton x:Name="ButtonQ1"
                             SmallImageSource="Image\add-Folder.png"
                             Label="ButtonQ1" />

                    </my:RibbonQuickAccessToolBar>
                </my:Ribbon.QuickAccessToolBar>
                <my:Ribbon.ApplicationMenu>
                    <my:RibbonApplicationMenu SmallImageSource="Image\Information.png">
                        <my:RibbonApplicationMenuItem  Header="Information" x:Name="Ri_Information" ImageSource="Image\Information.png"   >
                            <my:RibbonApplicationMenuItem Header="Code Plex, Open Source Community" ImageSource="Image\CodePlex.png" Click="Ri_InformationCodePlex_Click" />
                            <my:RibbonApplicationMenuItem Header="Rakudou,Inc" ImageSource="Image\logo.png" Click="Ri_InformationRakudou_Click"  />
                            <my:RibbonApplicationMenuItem Header="Information" x:Name="Ri_Information_Menu" ImageSource="Image\Information.png" Click="Ri_Information_Click" />
                        </my:RibbonApplicationMenuItem>
                        <my:RibbonApplicationMenuItem  />
                        <my:RibbonApplicationMenuItem  />
                        <my:RibbonApplicationMenuItem  />
                    </my:RibbonApplicationMenu>

                </my:Ribbon.ApplicationMenu>
                <my:RibbonTab x:Name="Ri_Action" Header="Action">
                    <my:RibbonGroup x:Name="GrRefresh" Header="">
                        <my:RibbonButton x:Name="Ri_bt_Refresh" Width="40" Height="80" Label="Azure" SmallImageSource="/AzureDriverExplorer_Client;component/Image/refresh.png" LargeImageSource="/AzureDriverExplorer_Client;component/Image/refresh.png" Click="Ri_bt_Refresht_Click" />
                    </my:RibbonGroup>
                </my:RibbonTab>
                <my:RibbonTab x:Name="Ri_View" Header="View">
                    <my:RibbonGroup x:Name="GrUploadListr" Header="Upload">
                        <my:RibbonButton x:Name="Ri_bt_UploadList" Width="65" Height="80" Label="List" SmallImageSource="/AzureDriverExplorer_Client;component/Image/up.png" LargeImageSource="/AzureDriverExplorer_Client;component/Image/up.png" Click="Ri_bt_UploadList_Click" />
                        <my:RibbonButton x:Name="Ri_bt_DownList" Width="65" Height="80" Label="List" SmallImageSource="/AzureDriverExplorer_Client;component/Image/Down.png" LargeImageSource="/AzureDriverExplorer_Client;component/Image/Down.png" Click="Ri_bt_DownloadList_Click" />
                    </my:RibbonGroup>
                </my:RibbonTab>
                <my:RibbonTab x:Name="Ri_Language" Header="Language">
                    <my:RibbonGroup x:Name="GrLanguage" Header="Language">
                        <ComboBox x:Name="CBLanguage" SelectionChanged="ComboBox_SelectionChanged">
                            <ComboBoxItem Content="English" />
                            <ComboBoxItem Content="日本語" />
                            <ComboBoxItem Content="Español" />
                        </ComboBox>
                    </my:RibbonGroup>
                </my:RibbonTab>
                <my:RibbonTab x:Name="Ri_Settings" Header="VHD">
                    <my:RibbonGroup x:Name="AddConfig" Header="Connection">
                        <my:RibbonButton x:Name="Ri_bt_AddConfig" Width="60" Height="80" Label="Add" SmallImageSource="/AzureDriverExplorer_Client;component/Image/AddList.png" LargeImageSource="/AzureDriverExplorer_Client;component/Image/AddList.png" Click="Ri_bt_AddConfig_Click" />
                        <my:RibbonButton x:Name="Ri_bt_ConfigEdit" Width="60" Height="80" Label="Edit" SmallImageSource="/AzureDriverExplorer_Client;component/Image/edit.png" LargeImageSource="/AzureDriverExplorer_Client;component/Image/edit.png" Click="Ri_bt_AddConfig_Click" />
                        <my:RibbonButton x:Name="Ri_bt_ConfigDelete" Width="60" Height="80" Label="Delete" SmallImageSource="/AzureDriverExplorer_Client;component/Image/DeleteRegister.png" LargeImageSource="/AzureDriverExplorer_Client;component/Image/DeleteRegister.png" Click="Ri_bt_AddConfig_Click" />
                    </my:RibbonGroup>
                    <my:RibbonGroup x:Name="VHD" Header="VHD">
                        <my:RibbonButton x:Name="Ri_bt_AddVHD" Width="60" Height="80" Label="Create"  LargeImageSource="/AzureDriverExplorer_Client;component/Image/vhdAdd.png" Click="Ri_bt_VhdCreate_Click" />
                        <my:RibbonButton x:Name="Ri_bt_UploadVHD" Width="60" Height="80" Label="Upload"  LargeImageSource="/AzureDriverExplorer_Client;component/Image/vhdUpload1.png" Click="Ri_bt_VhdUpload_Click" />
                        <my:RibbonButton x:Name="Ri_bt_BackUpVHD" Width="60" Height="80" Label="Backup"  LargeImageSource="/AzureDriverExplorer_Client;component/Image/vhdBackup.png" Click="Ri_bt_BackupDelete_Click" />
                        <my:RibbonButton x:Name="Ri_bt_DeleteVHD" Width="60" Height="80" Label="Delete"  LargeImageSource="/AzureDriverExplorer_Client;component/Image/vhdDelete.png" Click="Ri_bt_BackupDelete_Click" />
                    </my:RibbonGroup>

                </my:RibbonTab>
            </my:Ribbon>
            <!--*********** RIBBON END ****************-->

            <TreeView Name="Tre_Local" Grid.Column="0" Grid.Row="1" Height="auto" Width="auto"  TreeViewItem.Selected="Tre_Local_Selected" Grid.RowSpan="2" SelectedItemChanged="SolutionTree_SelectedItemChanged" >
                <TreeView.Resources>
                    <ContextMenu x:Key="FolderContext"   StaysOpen="true" Opened="ContextMenu_Opened" >
                        <MenuItem x:Name="menuLocalUploadFolder" Header="Upload" Tag="{Binding}" Click="TreeMenuItemAdd_Click" >
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/up.png" Width="16" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <Separator/>
                        <MenuItem Header=""  Click="treeViewLocalAddFolder"  >
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/Get_list.png" Width="16" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="Rename Folder" Click="treeViewLocalRenameFolder">
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/rename_file.png"  />
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="Delete Folder" Click="treeViewLocalDeleteFolder">
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/delete_file.png" Width="16" />
                            </MenuItem.Icon>
                        </MenuItem>
                    </ContextMenu>
                </TreeView.Resources>
            </TreeView>

            <GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Grid.Column="1" Grid.Row="1" ResizeBehavior="PreviousAndNext" Width="2" Background="#FFBCBCBC" />

            <Grid Grid.Row="1" Grid.Column="2" Background="White">
                <Image  Name="BackgroundImageLocalList"   Margin="0,0,1,1" Source="/AzureDriverExplorer_Client;component/Image/hdd.jpg" />
                <!--***************Local List*******************-->

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="24" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Image Source="/AzureDriverExplorer_Client;component/Image/TreeView/OpenFolder.ico"></Image>
                            <TextBox Grid.Column="1" x:Name="BackgraoundLocal" Width="auto"  Background="#1F7FFF00" PreviewMouseDown="LocalGoTXT_PreviewMouseDown"  KeyUp="LocalGoTXT_KeyUp2"  />
                            <TextBox Grid.Column="1" x:Name="LocalGoTXT" Width="auto" Background="#1F7FFF00"  KeyUp="LocalGoTXT_KeyUp"  Visibility="Visible"  TextChanged="LocalGoTXT_TextChanged" />
                            <Grid Grid.Column="1" HorizontalAlignment="Left"  >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto" />
                                    <ColumnDefinition Width="auto" />
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                </Grid.ColumnDefinitions>
                                <ComboBox x:Name="pathLocalMenu0"  Grid.Column="0" SelectionChanged="pathLocalMenu0_SelectionChanged" Width="17" Background="#00008A00" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathLocal0" Width="auto" Grid.Column="1" Content="" Visibility="Hidden" Background="#00008A00" BorderBrush="#00000000" Click="pathLocal0_Click"></Button>
                                <ComboBox x:Name="pathLocalMenu1" Grid.Column="2" SelectionChanged="pathLocalMenu0_SelectionChanged" Width="17" Background="#00008A00" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathLocal1" Width="auto" Grid.Column="3" Content="" Visibility="Hidden" Background="#00008A00" BorderBrush="#00000000" Click="pathLocal0_Click"></Button>
                                <ComboBox x:Name="pathLocalMenu2" Grid.Column="4" SelectionChanged="pathLocalMenu0_SelectionChanged" Width="17" Background="#00008A00" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathLocal2" Width="auto" Grid.Column="5" Content="" Visibility="Hidden" Background="#00008A00" BorderBrush="#00000000" Click="pathLocal0_Click"></Button>
                                <ComboBox x:Name="pathLocalMenu3" Grid.Column="6" SelectionChanged="pathLocalMenu0_SelectionChanged" Width="17" Background="#00008A00" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathLocal3" Width="auto" Grid.Column="7" Content="" Visibility="Hidden" Background="#00008A00" BorderBrush="#00000000" Click="pathLocal0_Click"></Button>
                                
                            </Grid>
                        </Grid>                        
                        <ListView  Grid.Row="1"  x:Name="ListViewLocal"  Width="Auto" AllowDrop="True"  PreviewMouseLeftButtonDown="List_PreviewMouseLeftButtonDown" PreviewMouseMove="List_MouseMove"  SelectionMode="Extended" PreviewMouseRightButtonDown="ListViewLocal_PreviewMouseRightButtonDown"  Background="{x:Null}" Drop="DropListLocal_Drop" DragEnter="DropListLocal_DragEnter">

                            <ListView.ItemContainerStyle>
                                <Style TargetType="{x:Type ListViewItem}">
                                    <EventSetter Event="PreviewMouseRightButtonDown"
                                                 Handler="OnListViewItemPreviewMouseRightButtonDown" />

                                    <EventSetter Event="MouseDoubleClick"
                                                 Handler="OpenFileLocal" />

                                </Style>
                            </ListView.ItemContainerStyle>
                            <ListView.ContextMenu>
                                <ContextMenu Opened="ListViewLocalMenu_Opened">
                                    <MenuItem x:Name="menuLocalUpload" Header="Upload" Tag="{Binding}" Click="MenuItemAdd_Click" >
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/up.png" Width="16" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <Separator/>
                                    <MenuItem  x:Name="menuLocalRename" Header="Rename"   Tag="{Binding}"  Click="MenuItemRename_Click"  Visibility="{Binding Path=M1Visibility}">
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/rename_file.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="menuLocalCopy"  Header="Copy"    Tag="{Binding}" Click="MenuItemCopy_Click">
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/copy.png" Width="16" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="menuLocalPaste"  Header="Paste"     Click="MenuItemPaste_Click">
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/paste.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <Separator/>
                                    <MenuItem x:Name="menuLocalDelete"  Header="Delete"  Tag="{Binding}" Click="MenuItemDelete_Click" >
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/delete_file.png" Width="16" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                </ContextMenu>
                            </ListView.ContextMenu>
                            <ListView.View>
                                <GridView AllowsColumnReorder="true"  ColumnHeaderToolTip="InfoFile" >
                                    <GridViewColumn Width="200" >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <Image Width="24" Grid.Column="0" Source="{Binding Image}" />
                                                    <Image Width="24" Grid.Column="0" Source="{Binding RenameImage}" Visibility="{Binding Rename}" />
                                                    <TextBlock Grid.Column="1" VerticalAlignment="Center"  Text="{Binding Name}" />
                                                    <!--Rename-->
                                                    <Grid Grid.Column="1" >
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto" />
                                                            <ColumnDefinition Width="Auto" />
                                                            <ColumnDefinition Width="Auto" />
                                                        </Grid.ColumnDefinitions>
                                                        <TextBox Grid.Column="0"  Text="{Binding RenameText}" x:Name="txtRename" Visibility="{Binding Rename}" Background="#FFCAEFCA"></TextBox>
                                                        <Button Grid.Column="1" Width="22" Height="20"  Visibility="{Binding Rename}" Tag="{Binding}" Click="RenameSave_Click">
                                                            <Image  Source="/AzureDriverExplorer_Client;component/Image/yes.png" />
                                                        </Button>
                                                        <Button Grid.Column="2" Width="22" Height="20"  Visibility="{Binding Rename}" Tag="{Binding}" Click="RenameCancel_Click" >
                                                            <Image  Source="/AzureDriverExplorer_Client;component/Image/delete_file.png" />
                                                        </Button>
                                                    </Grid>

                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                        <GridViewColumnHeader Click="SortLocalClick" Tag="Name" x:Name="ColName" Content="Name" />
                                    </GridViewColumn>
                                    <GridViewColumn  Width="180" DisplayMemberBinding="{Binding Path=Date}" >
                                        <GridViewColumnHeader Click="SortLocalClick" Tag="Date" x:Name="ColDate" Content="Date" />
                                    </GridViewColumn>
                                    <GridViewColumn Width="100" DisplayMemberBinding="{Binding Path=Type}" >
                                        <GridViewColumnHeader Click="SortLocalClick" Tag="Type" Content="Type" x:Name="ColType" />
                                    </GridViewColumn>
                                    <GridViewColumn Width="100"  >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid Visibility="{Binding HiddenBytes}">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <TextBlock Grid.Column="0" VerticalAlignment="Center"  Text="{Binding Size}" />
                                                    <TextBlock Grid.Column="1" VerticalAlignment="Center"  Text=" Bytes" />
                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                        <GridViewColumnHeader Click="SortLocalClick" Tag="Size" Content="Size" x:Name="ColSize" />

                                    </GridViewColumn>
                                </GridView>

                            </ListView.View>

                        </ListView>
                    </Grid>
                    <Grid  Grid.Row="1" Height="200" x:Name="GridViewLocalProgress" Visibility="Collapsed">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                        </Grid.RowDefinitions>
                        <Button Grid.Row="0" Width="22" Height="20" HorizontalAlignment="Right" Click="CollapseUploadList_Click">
                            <Image Source="/AzureDriverExplorer_Client;component/Image/collapse2.jpg" />
                        </Button>
                        <ListView  Grid.Row="1" Height="178"  x:Name="ListViewLocalProgress"  KeyUp="ListViewLocalProgress_KeyUp" Background="#1F7FFF00">
                            <ListView.View >
                                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="InfoFile">
                                    <GridViewColumn Width="200" Header="Name" x:Name="ColUProgressName" >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <Image Width="15" Grid.Column="0"  Source="/AzureDriverExplorer_Client;component/Image/up.png" />
                                                    <TextBlock Grid.Column="1" VerticalAlignment="Center"  Text="{Binding Name}" />
                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Width="Auto" Header="Progress" x:Name="ColUProgressProgress" >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <ProgressBar  Grid.Column="0"  Value="{Binding Valueprogress}" Width="150" Height="15"  OpacityMask="{x:Null}" BorderBrush="{Binding ColorFill}" Background="#E6E1DFCD" Foreground="{Binding ColorFill}">
                                                    </ProgressBar>
                                                    <TextBlock  Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"  Text="{Binding Textprogress}" />
                                                    <Image Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"  Height="15" Width="15" Source="/AzureDriverExplorer_Client;component/Image/Cancel.png" />
                                                    <Button Grid.Column="1"  Tag="{Binding}"  Click="CancelProssesUpload" Height="15" Width="15" Style="{StaticResource StyleCancelBotton}"  HorizontalAlignment="Center" VerticalAlignment="Center"  >
                                                    </Button>
                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Width="auto" Header="Out Path" DisplayMemberBinding="{Binding Path=OutPath}" x:Name="ColUProgressOut"  />
                                    <GridViewColumn Width="auto" Header="In Path" DisplayMemberBinding="{Binding Path=InPath}" x:Name="ColUProgressIn"  />
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </Grid>
            </Grid>

            <!--***************Local List END *******************-->

            
                <!--***************AZURE List*******************-->
            <GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Grid.Column="3" Grid.Row="1" ResizeBehavior="PreviousAndNext" Width="5" Background="#FFBCBCBC" />
            <Grid Grid.Column="4" Grid.Row="1" Background="White">
                <Image  Name="BackgroundImageAzureList"   Margin="0,0,1,1" Source="/AzureDriverExplorer_Client;component/Image/hddAzure.jpg" />
                <Grid   >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>

                    <Grid Grid.Row="0" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="24" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Image Source="/AzureDriverExplorer_Client;component/Image/TreeView/OpenFolder.ico"></Image>
                            <TextBox Grid.Column="1" x:Name="BackgraoundAzure" Width="auto" Background="#1F7FFFFF" KeyUp="AzureGoTXT_KeyUp2" PreviewMouseDown="AzureGoTXT_PreviewMouseDown" />
                            <TextBox Grid.Column="1" x:Name="AzureGoTXT" Width="auto" Background="#1F7FFFFF" KeyUp="AzureGoTXT_KeyUp"  Visibility="Hidden" TextChanged="AzureGoTXT_TextChanged" ></TextBox> 
                            <Grid Grid.Column="1" HorizontalAlignment="Left"  >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto" />
                                    <ColumnDefinition Width="auto" />
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                </Grid.ColumnDefinitions>
                                <ComboBox x:Name="pathAzureMenu0"  Grid.Column="0" SelectionChanged="pathAzureMenu0_SelectionChanged" Width="17" Background="#1F7FFFFF" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathAzure0" Width="auto" Grid.Column="1" Content="" Visibility="Hidden" Background="#1F7FFFFF" BorderBrush="#00000000" Click="pathAzure0_Click"></Button>
                                <ComboBox x:Name="pathAzureMenu1"  Grid.Column="2" SelectionChanged="pathAzureMenu0_SelectionChanged" Width="17" Background="#1F7FFFFF" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathAzure1" Width="auto" Grid.Column="3" Content="" Visibility="Hidden" Background="#1F7FFFFF" BorderBrush="#00000000" Click="pathAzure0_Click"></Button>
                                <ComboBox x:Name="pathAzureMenu2"  Grid.Column="4" SelectionChanged="pathAzureMenu0_SelectionChanged" Width="17" Background="#1F7FFFFF" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathAzure2" Width="auto" Grid.Column="5" Content="" Visibility="Hidden" Background="#1F7FFFFF" BorderBrush="#00000000" Click="pathAzure0_Click"></Button>
                                <ComboBox x:Name="pathAzureMenu3"  Grid.Column="6" SelectionChanged="pathAzureMenu0_SelectionChanged" Width="17" Background="#1F7FFFFF" BorderBrush="#00000000" Visibility="Hidden" />
                                <Button x:Name="pathAzure3" Width="auto" Grid.Column="7" Content="" Visibility="Hidden" Background="#1F7FFFFF" BorderBrush="#00000000" Click="pathAzure0_Click"></Button>
                            </Grid>
                        </Grid>

                        <ListView  x:Name="ListViewAzure" Grid.Row="1" Width="Auto"  Background="{x:Null}" Drop="DropListAzure_Drop" DragEnter="DropListAzure_DragEnter" PreviewMouseRightButtonDown="ListViewAzure_PreviewMouseRightButtonDown"  AllowDrop="True"  PreviewMouseLeftButtonDown="List_PreviewMouseLeftButtonDownAzure" PreviewMouseMove="List_MouseMoveAzure" >

                            <ListView.ItemContainerStyle>
                                <Style TargetType="{x:Type ListViewItem}">
                                    <EventSetter Event="PreviewMouseRightButtonDown"
                                                 Handler="OnListViewItemPreviewMouseRightButtonDown" />

                                    <EventSetter Event="MouseDoubleClick"
                                                 Handler="OpenFileAzure" />
                                </Style>
                            </ListView.ItemContainerStyle>

                            <ListView.ContextMenu>
                                <ContextMenu Opened="ListViewAzureMenu_Opened" >
                                    <MenuItem x:Name="menuAzureDownload" Header="Upload" Tag="{Binding}" Click="MenuItemAddDownload_Click" >
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/Down.png" Width="16" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <Separator/>
                                    <MenuItem x:Name="menuAzureRename"  Header="Rename"   Tag="{Binding}"  Click="MenuItemAzureRename_Click">
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/rename_file.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="menuAzureCopy"  Header="Copy"    Tag="{Binding}" Click="MenuItemAzureCopy_Click" >
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/copy.png" Width="16"  />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <MenuItem x:Name="menuAzurePaste" Header="Paste"     Click="MenuItemAzurePaste_Click" >
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/paste.png" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                    <Separator/>
                                    <MenuItem  x:Name="menuAzureDelete"  Header="Delete"  Tag="{Binding}" Click="MenuItemDeleteAzure_Click" >
                                        <MenuItem.Icon>
                                            <Image Source="/AzureDriverExplorer_Client;component/Image/delete_file.png" Width="16" />
                                        </MenuItem.Icon>
                                    </MenuItem>
                                </ContextMenu>

                            </ListView.ContextMenu>
                            <ListView.View>
                                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="InfoFile">
                                    <GridViewColumn Width="200" >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <Image Width="24" Grid.Column="0" Source="{Binding Image}" />
                                                    <TextBlock Grid.Column="1" VerticalAlignment="Center"  Text="{Binding Name}" />
                                                    <!--Rename-->
                                                    <Grid Grid.Column="1" >
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto" />
                                                            <ColumnDefinition Width="Auto" />
                                                            <ColumnDefinition Width="Auto" />
                                                        </Grid.ColumnDefinitions>
                                                        <TextBox Grid.Column="0"  Text="{Binding RenameText}" x:Name="txtRename" Visibility="{Binding Rename}" Background="#FFC0EFF2"></TextBox>
                                                        <Button Grid.Column="1" Width="22" Height="20"  Visibility="{Binding Rename}" Tag="{Binding}" Click="RenameAzureSave_Click">
                                                            <Image  Source="/AzureDriverExplorer_Client;component/Image/yes.png" />
                                                        </Button>
                                                        <Button Grid.Column="2" Width="22" Height="20"  Visibility="{Binding Rename}" Tag="{Binding}" Click="RenameAzureCancel_Click" >
                                                            <Image  Source="/AzureDriverExplorer_Client;component/Image/delete_file.png" />
                                                        </Button>
                                                    </Grid>

                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                        <GridViewColumnHeader Click="SortAzureClick" Tag="Name" Content="Name" x:Name="ColNameAzure" />
                                    </GridViewColumn>
                                    <GridViewColumn  Width="180" DisplayMemberBinding="{Binding Path=Date}" >
                                        <GridViewColumnHeader Click="SortAzureClick" Tag="Date" Content="Date" x:Name="ColDateAzure" />
                                    </GridViewColumn>
                                    <GridViewColumn Width="100" DisplayMemberBinding="{Binding Path=Type}" >
                                        <GridViewColumnHeader Click="SortAzureClick" Tag="Type" Content="Type" x:Name="ColTypeAzure" />
                                    </GridViewColumn>
                                    <GridViewColumn Width="100" >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid Visibility="{Binding HiddenBytes}">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <TextBlock Grid.Column="0" VerticalAlignment="Center"  Text="{Binding Size}" />
                                                    <TextBlock Grid.Column="1" VerticalAlignment="Center"  Text=" Bytes" />
                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                        <GridViewColumnHeader Click="SortAzureClick" Tag="Size" Content="Size" x:Name="ColSizeAzure" />

                                    </GridViewColumn>

                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                    <Grid  Grid.Row="1" Height="200" x:Name="GridViewAzureProgress" Visibility="Collapsed">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                        </Grid.RowDefinitions>
                        <Button Grid.Row="0" Width="22" Height="20" HorizontalAlignment="Right" Click="CollapseDownloadList_Click">
                            <Image Source="/AzureDriverExplorer_Client;component/Image/collapse2.jpg" />
                        </Button>
                        <ListView  Grid.Row="1" Height="178"  x:Name="ListViewAzureProgress"  KeyUp="ListViewAzureProgress_KeyUp" Background="#1F7FFFFF">
                            <ListView.View >
                                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="InfoFile">
                                    <GridViewColumn Width="200" Header="Name" x:Name="ColDProgressName" >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <Image Width="15" Grid.Column="0"  Source="/AzureDriverExplorer_Client;component/Image/Down.png" />
                                                    <TextBlock Grid.Column="1" VerticalAlignment="Center"  Text="{Binding Name}" />
                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Width="Auto" Header="Progress" x:Name="ColDProgressProgress" >
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate >
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <ProgressBar  Grid.Column="0"  Value="{Binding Valueprogress}" Width="150" Height="15"  OpacityMask="{x:Null}" BorderBrush="{Binding ColorFill}" Background="#E6E1DFCD" Foreground="{Binding ColorFill}">
                                                    </ProgressBar>
                                                    <TextBlock  Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"  Text="{Binding Textprogress}" />
                                                    <Image Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"  Height="15" Width="15" Source="/AzureDriverExplorer_Client;component/Image/Cancel.png" />
                                                    <Button Grid.Column="1"  Tag="{Binding}"  Click="CancelProssesDownload" Height="15" Width="15" Style="{StaticResource StyleCancelBotton}"  HorizontalAlignment="Center" VerticalAlignment="Center"  >
                                                    </Button>
                                                </Grid>
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Width="auto" Header="Out Path" DisplayMemberBinding="{Binding Path=OutPath}" x:Name="ColDProgressOut" />
                                    <GridViewColumn Width="auto" Header="In Path" DisplayMemberBinding="{Binding Path=InPath}" x:Name="ColDProgressIn" />
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </Grid>
            </Grid>
            <GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Grid.Column="5" Grid.Row="1" ResizeBehavior="PreviousAndNext" Width="2" Background="#FFBCBCBC" />

            <TreeView Name="Tre_Azure" Grid.Column="6" Grid.Row="1" Height="auto" Width="auto" TreeViewItem.Selected="Tre_Azure_Selected" Grid.RowSpan="2" SelectedItemChanged="SolutionTreeAzure_SelectedItemChanged">
                <TreeView.Resources>
                    <ContextMenu x:Key="FolderContext"  StaysOpen="true" Opened="ContextMenu_Opened">
                        <MenuItem x:Name="menuAzureDownloadFolder" Header="Upload" Tag="{Binding}" Click="TreeMenuItemAzureAdd_Click" >
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/Down.png" Width="16" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <Separator/>
                        <MenuItem Header="Add Folder" Click="treeViewAzureAddFolder"   >
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/Get_list.png" Width="16" />
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="Rename Folder" Click="treeViewAzureRenameFolder">
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/rename_file.png"  />
                            </MenuItem.Icon>
                        </MenuItem>
                        <MenuItem Header="Delete Folder" Click="treeViewAzureDeleteFolder">
                            <MenuItem.Icon>
                                <Image Source="/AzureDriverExplorer_Client;component/Image/delete_file.png" Width="16" />
                            </MenuItem.Icon>
                        </MenuItem>
                    </ContextMenu>
                </TreeView.Resources>
            </TreeView>

            <ToolBar Height="29" Name="toolBar1" Width="auto" Grid.Column="0" Grid.Row="3"  Grid.ColumnSpan="7" />

        </Grid>
        <!--***************AZURE End*******************-->
        <!--************************* Popup ***************************-->

        <Frame x:Name="popupAddFrame"  />
        <!-- <Grid x:Name="popupAdd" Background="#7C000000" Visibility="Hidden">
            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="20" />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>
                <Grid Grid.Row="0"  Background="#FFDEDEDE">
                    <Image HorizontalAlignment="Right" VerticalAlignment="Stretch"  Height="20" Width="20" Source="/AzureDriverExplorer_Client;component/Image/Cancel.png" />
                    <Button   Height="20" Width="19" Style="{StaticResource StyleCancelBotton}"  HorizontalAlignment="Right" VerticalAlignment="Stretch" Click="Close_popupAdd_Click" />
                </Grid>
                <Frame x:Name="popupAddFrame" Grid.Row="1"  />
            </Grid>
        </Grid>-->

        <Frame x:Name="popupVhdUpload" />
        <Frame x:Name="popupVhdVHDAdd" />
        <!--<Grid x:Name="popupVhdUpload" Background="#7C000000" Visibility="Hidden">
            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="20" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Grid Grid.Row="0"  Background="#FF929292">
                    <Image HorizontalAlignment="Right" VerticalAlignment="Stretch"  Height="20" Width="20" Source="/AzureDriverExplorer_Client;component/Image/Cancel.png" />
                    <Button   Height="20" Width="19" Style="{StaticResource StyleCancelBotton}"  HorizontalAlignment="Right" VerticalAlignment="Stretch" Click="Close_popupVhdUpload_Click" />
                </Grid>
                <Frame Grid.Row="1" Source="VHDUpload.xaml" />
            </Grid>
        </Grid>-->

        <Frame x:Name="popupVHDBackupDelete"  />
        <!--<Grid  Background="#7C000000" Visibility="Hidden">
            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="20" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Grid Grid.Row="0"  Background="#FF929292">
                    <Image HorizontalAlignment="Right" VerticalAlignment="Stretch"  Height="20" Width="20" Source="/AzureDriverExplorer_Client;component/Image/Cancel.png" />
                    <Button   Height="20" Width="19" Style="{StaticResource StyleCancelBotton}"  HorizontalAlignment="Right" VerticalAlignment="Stretch" Click="Close_popupVHDBackupDelete_Click" />
                </Grid>
                <Frame Grid.Row="1" Source="VHDBackupDelete.xaml" />
            </Grid>
        </Grid>-->

        <Grid x:Name="popup" Background="#7C000000" Visibility="Hidden" />

        
    </Grid>

</Window>
